<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<title>客户信息修改</title>
</head>
<body>
	<s:form action="client_editById" method="post" name="f1" 
		onsubmit="return check()">
		<table class="table table-condensed table-hover table-striped">
			<s:iterator value="jsfClient" var="var">
				<tr>
					<td width="150">客户姓名： <input type="text" name="clientName"
						id="clientName" value='<s:property value="#var.name" />'>
						<font color="red">*</font>
						<input type="hidden" value='<s:property value="#var.id" />'
						name="clientId" id="clientId"></td>
				</tr>
				<tr>
					<td width="150">客户密码： <s:password id="clientPassword"
							name="clientPassword" theme="simple"></s:password>
							<font color="red">*</font></td>
				</tr>
				<tr>
					<td width="150">客户电话： <input type="text" name="clientPhoneNum"
						id="clientPhoneNum" value='<s:property value="#var.phoneNum" />'>
						<font color="red">*</font>
					</td>
				</tr>
				<tr>
					<td width="150">身份证号： <input type="text"
						name="clientIDcard" id="clientIDcard"
						value='<s:property value="#var.idCard" />'>
						<font color="red">*</font></td>
				</tr>
				<tr>
					<td width="150">客户住址：
					 <input type="text" name="clientAddress"
						id="clientAddress" value='<s:property value="#var.address" />'>
					</td>
				</tr>
				<tr>
					 <td width="150">出生日期：<input type="date" name="clientAge">
					 原日期：<s:property value="#var.age" />
					 </td>
				</tr>
				<tr><td width="150">客户性别：
					<s:if test="%{#var.sex == 1}">
					<input type="radio" name="clientSex" value="1" checked="checked"/>男
			    	<input type="radio" name="clientSex" value="0" />女
					</s:if><s:else>
					<input type="radio" name="clientSex" value="1" />男
			    	<input type="radio" name="clientSex" value="0" checked="checked" />女
					</s:else>
				<font color="red">*</font></td></tr>
		
				
				<tr><td><input type="submit" value="保存" class="btn btn-info"/></td>
			</s:iterator>
		</table>
	</s:form>
	<script type="text/javascript">
    function check(){
		var clientName = document.f1.clientName;
		var clientPassword = document.f1.clientPassword;
		var clientPhoneNum = document.f1.clientPhoneNum;
		var clientIDcard = document.f1.clientIDcard;
		var clientAddress = document.f1.clientAddress;
		var clientAge = document.f1.clientAge;
		var clientSex = document.f1.clientSex;
		var reNum =/^[0-9]+$/;
		if(clientName.value==""||clientPassword.value==""||clientPhoneNum.value==""||clientIDcard.value==""
		||clientSex.value==""){
			alert("必填项不能为空！");
			return false;
		}
		if(!reNum.test(clientPhoneNum.value) ){
			alert("“电话号码、年龄必须为数字！");
			return false;
		}
		
		else{
			return true;
		}
	}
    </script>
</body>
</html>